/*
 * @Author: 王锴 1148506760@qq.com
 * @Date: 2024-01-15 19:54:33
 * @LastEditors: 王锴 1148506760@qq.com
 * @LastEditTime: 2024-01-16 11:34:39
 * @Description: 
 */
import ReactECharts from "echarts-for-react"
import * as echarts from "echarts"
//定义组件可传参数
const EchartsDom = (props) => {
  const option = {
    grid: {
      left: "8%",
      top: "10%",
      right: "2%",
      bottom: "8%",
      borderWidth: 1,
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      top: '5%',
      left: 'center'
    },
    xAxis: {
      type: 'category',
      data: props.chartDomBarYear,
      axisLine: {
        lineStyle: {
          color: '#fff',
        },
      },
    },
    yAxis: {
      name: "单位:(kg)",
      type: 'value',
      axisLine: {
        lineStyle: {
          color: '#fff',
        },
      },
    },
    series: [
      {
        data: props.chartDomBarNum,
        type: 'bar'
      }
    ]
  };
  return (
    <ReactECharts option={option} style={{ width: `${props?.wight}`, height: `${props?.height}` }} ></ReactECharts>
  )
}
export default EchartsDom;